<template>
	<view>
		<!-- 底部导航栏 -->
		<!-- <nav-bar title="就业详情" :back="true" :showCow="false"></nav-bar> -->
		<!-- 就业头部信息 -->
		<view class="empHeader w100">
			<image :src="detailObj.image" class="w100"></image>
			<view class="headerTitle">{{detailObj.title}}</view>
		</view>
		<!-- 就业基本信息 -->
		<view class="empDetail ">
			<view class="detailHeader df-js-cen">
				<div class="heng"></div>
				<div class="title " v-html="detailObj.content"></div>
				<div class="heng"></div>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		formatRichImg
	} from '../common';
	import {
		getJob
	} from '/api/common.js';


	export default {
		data() {
			return {
				detailObj: {},
				html: '',

			}
		},
		onPageScroll(res) {
			// console.log("页面滚动了")
			uni.$emit('onPageScroll', res.scrollTop)
		},
		onLoad(data) {
			this.getJobDetail(data.id)
		},
		methods: {
			async getJobDetail(id) {
				let res = await getJob(id)
				let data = res.data.data
				data.content = formatRichImg(data.content || '')
				this.detailObj = res.data.data
			},

		}
	}
</script>

<style lang="scss" scoped>
	page {
		background-color: #f4f4f4;
	}

	.empHeader {
		image {
			height: 50vh;
		}

		.headerTitle {
			background-color: #fff;
			font-size: 40rpx;
			font-weight: 550;
			padding: 20rpx;
		}
	}

	.empDetail {
		margin-top: 20rpx;

		.detailHeader {
			.heng {
				width: 100rpx;
				border-bottom: 1px solid #f4f4f4;
			}

			.title {
				overflow: hidden;

				img {
					width: 100vw !important;
				}
			}
		}

	}
</style>